<include file="Common/header" xmlns="http://www.w3.org/1999/html"/>
<div class="container">
    <div class="row">

            <include file="Tools/tools-sidber" />

        <div class="col-md-10">
            <div class="page-header"><h3>{$page_title}</h3></div>
            <a  class="btn btn-default" href="{:U('Links/index')}">ئۇلىنىشلار</a>&nbsp;
            <a  class="btn btn-default" href="{:U('Links/add')}">ئۇلىنىش قۇشۇش</a>
            <br><br>
               <foreach name="link" item="l">
            <div class="btn-group" role="group">
                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                    {$l['lname']}
                    <span class="caret"></span>
                </button>
                <ul class="dropdown-menu">
                    <li><a href="{:U('Links/edit',array('id'=>$l['id']))}">تەھرىرلەش</a></li>
                    <li><a href="javascript:delLinks({$l['id']})">ئۆچۈرۈش</a></li>
                </ul>
            </div>&nbsp;&nbsp;&nbsp;&nbsp;
               </foreach>
        </div>

</div>
    <script>
        function delLinks(id)
        {
            layer.confirm('راستىنلا ئۆچۈرەمسىز؟',{
             btn:['ھەئە','ياق']
        } ,function () {
                $.ajax({
                  'url':"{:U('Links/delete')}",
                    'type':'POST',
                    'dataType':'json',
                    'data':{'id':id},
                    success:function(phpReturnData){
                      if(phpReturnData.status==1){
                          layer.msg(phpReturnData.message,{'icon':6},function () {
                              window.location=location;
                          } )
                      }else{
                          layer.msg(phpReturnData.message,{'icon':5});
                      }
                }
                })
            })
        }
    </script>
<include file="Common/footer" />